<template>
	<div class="historyorder">
		<template>
			<el-table :data="historyorder" stripe style="margin-bottom: 100px;">
				<el-table-column prop="setid" label="桌号"></el-table-column>
				<el-table-column label="菜品列表">
					<template v-for="item of foodlist">
						{{item.foodname}}
					</template>
				</el-table-column>
		        <el-table-column prop="sumprice" label="总计"></el-table-column>
				<el-table-column prop="settime" label="开桌时间"></el-table-column>
				<el-table-column  label="操作">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="resert(scope.row.foodid)">修改</el-button>
						<el-button size="mini" type="danger" @click="deletes(scope.row.foodid)">删除</el-button>
					</template>
				</el-table-column>
		  </el-table>
		</template>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				historyorder:[],
				foodlist:[],
			}
		},
		mounted(){
			this.$axios.get(`${this.$httpurl}/gethistoryorder`).then((response)=>{
				this.historyorder = response.data
				this.foodlist =JSON.parse(response.data[0].foodlist)
			})
		}
		
	}
</script>

<style>
	.cell {
			text-align: center;
	}
</style>
